import Vue from "vue";
import Router from "vue-router";
import homePage from "@/route/homePage/router.js";
import projectManagementPage from "@/route/projectManagementPage/router.js";
import dataCollectionPage from "@/route/dataCollectionPage/router.js";
import auditAnalysisPage from "@/route/auditAnalysisPage/router.js";
import auditOperationPage from "@/route/auditOperationPage/router.js";
import assistantToolPage from "@/route/assistantToolPage/router.js";
import systemManagementPage from "@/route/systemManagementPage/router.js";
import helpPage from "@/route/helpPage/router.js";
//导入
// import NProgress from 'nprogress'
// import 'nprogress/nprogress.css'
Vue.use(Router);

// router.beforeEach((to, from, next) => {
//   NProgress.start()
//   next()
// })
// router.afterEach(() => {
//   NProgress.done()
// })

const router = new Router({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes: [{
            path: "*",
            name: "find404",
            meta: {
                hidden: true
            },
            component: () => import("@/components/404.vue")
        },
        {
            path: "/login",
            name: "login",
            component: () => import("@/views/login.vue")
        },
        {
            path: "/",
            redirect: '/homePage'
        },
        ...homePage, //  首页
        ...projectManagementPage, //  项目管理
        ...dataCollectionPage, //数据采集
        ...auditAnalysisPage, //审计分析
        ...auditOperationPage, //审计作业
        ...assistantToolPage, //辅助工具
        ...systemManagementPage, //系统管理
        ...helpPage, //帮助
    ]
});


export default router;